﻿using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_Default : Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SiteMapNode firstNode = SiteMap.Provider.CurrentNode.ChildNodes[0];
            repaeter1.DataSource = firstNode.ChildNodes;
            repaeter1.DataBind();
        }
    }

    protected void HeadMenuClick(object sender, BulletedListEventArgs e)
    {
        ListItem item = HeadMenu.Items[e.Index];
        SiteMapNode current = SiteMap.Provider.FindSiteMapNodeFromKey(item.Value);
        repaeter1.DataSource = current.ChildNodes;
        repaeter1.DataBind();
    }

    protected string GetFirstMenu()
    {
        ListItem item = HeadMenu.Items[0];
        SiteMapNode current = SiteMap.Provider.FindSiteMapNodeFromKey(item.Value);
        return current.ChildNodes[0].ChildNodes[0].Url;
    }
}